from datetime import datetime

from sanic import Blueprint

from apps.model import BlogPost

bp = Blueprint('api', url_prefix='/api/v1/bp')


@bp.route('/')
async def index(request):
    t1 = BlogPost(title="sanic")
    t1.save()
    return {"msg": "index", "date": datetime.now()}
